package cn.jiyun.controller;

import cn.jiyun.pojo.User;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.ArrayList;

/**
 * @author Fay
 * @date 2022/6/20&16:52
 */
@Controller
public class UserNameController {
    @GetMapping("/username")
    public String username(Model model){
        ArrayList<User> userList = new ArrayList<>();
        userList.add(new User("张三","1","男"));
        userList.add(new User("李四","2","女"));
        userList.add(new User("王五","3","女"));
        userList.add(new User("赵六","4","男"));
        model.addAttribute("username","张三");
        model.addAttribute("birth","2021/1/2");
        model.addAttribute("msg","123456789");
        model.addAttribute("sex","男");
        model.addAttribute("userList",userList);
        return "hello";
    }
}
